/*
 * Powered By XY
 * Since 2020
 */

package com.xy.biz.ts.manager.impl;

import java.util.Collection;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.xy.biz.ts.domain.bo.ExaminationPaperRuleBO;
import com.xy.biz.ts.domain.query.ExaminationPaperRuleQuery;
import com.xy.biz.ts.domain.converter.ExaminationPaperRuleConverter;
import com.xy.biz.ts.manager.ExaminationPaperRuleManager;
import com.xy.biz.ts.dao.ExaminationPaperRuleDao;

/**
 *
 *
 * @author wwj
 * @date 2021-3-25
 */
@Service
public class ExaminationPaperRuleManagerImpl implements ExaminationPaperRuleManager {

	@Autowired
	private ExaminationPaperRuleDao examinationPaperRuleDao;

	@Override
	public int saveExaminationPaperRule(ExaminationPaperRuleBO examinationPaperRuleBO) {
		return examinationPaperRuleDao.saveExaminationPaperRule(ExaminationPaperRuleConverter.toPO(examinationPaperRuleBO));
	}

	@Override
	public int saveAllExaminationPaperRule(Collection<ExaminationPaperRuleBO> collection) {
		return examinationPaperRuleDao.saveAllExaminationPaperRule(ExaminationPaperRuleConverter.toPO(collection));
	}

	@Override
	public int updateExaminationPaperRule(ExaminationPaperRuleBO examinationPaperRuleBO) {
		return examinationPaperRuleDao.updateExaminationPaperRule(ExaminationPaperRuleConverter.toPO(examinationPaperRuleBO));
	}

	@Override
	public int deleteExaminationPaperRule(Long examinationPaperRuleId) {
		return examinationPaperRuleDao.deleteExaminationPaperRule(examinationPaperRuleId);
	}

	@Override
	public ExaminationPaperRuleBO getExaminationPaperRule(Long examinationPaperRuleId) {
		return ExaminationPaperRuleConverter.fromPO(examinationPaperRuleDao.getExaminationPaperRule(examinationPaperRuleId));
	}

	/**
	 * 查找一个
	 * @return
	 * @param query
	 */
	@Override
	public ExaminationPaperRuleBO getExaminationPaperRuleByQuery(ExaminationPaperRuleQuery query) {
		return ExaminationPaperRuleConverter.fromPO(examinationPaperRuleDao.getExaminationPaperRuleByQuery(query));
	}

	@Override
	public List<ExaminationPaperRuleBO> listExaminationPaperRuleById(Collection<Long> collection) {
		return ExaminationPaperRuleConverter.fromPO(examinationPaperRuleDao.listExaminationPaperRuleById(collection));
	}

	@Override
	public List<ExaminationPaperRuleBO> listExaminationPaperRule(ExaminationPaperRuleQuery query) {
		return ExaminationPaperRuleConverter.fromPO(examinationPaperRuleDao.listExaminationPaperRule(query));
	}

	@Override
	public int countExaminationPaperRule(ExaminationPaperRuleQuery query) {
		return examinationPaperRuleDao.countExaminationPaperRule(query);
	}

}
